package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scan =new Scanner(System.in);
        FileOutputStream fos=new FileOutputStream("note.txt");
        String line;
        System.out.println("请输入");
        while (true){
            line=scan.nextLine();
            if ("exit".equals(line)){
                break;
            }else {
                fos.write(line.getBytes(StandardCharsets.UTF_8));
            }
        }
        System.out.println("结束");
        fos.close();





















      /*  System.out.println("请输入内容");
        while (true) {
            line=scan.nextLine();
            if ("exit".equals(line)){
                break;
            }
            fos.write(line.getBytes(StandardCharsets.UTF_8));
        }
        System.out.println("结束");
        fos.close();

       */






    }
}
